﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Class_Entity;
using BussinessObject;

public partial class WebApplication_ADAddContactUs : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btSubmit_Click(object sender, EventArgs e)
    {
        ContactUs cu = new ContactUs();
        BOContactUs bocu = new BOContactUs();



        cu.BranchName = txtName.Text.Trim();
        cu.Address = txtAddress.Text.Trim();
        cu.Phone = Convert.ToInt32(txtPhone.Text.Trim());
        cu.Fax = Convert.ToInt32(txtFax.Text.Trim());

        bocu.Add_ContactUs(cu);


        Response.Write("<script>alert('Insert success !')</script>");
        Response.Redirect("ADContactUs.aspx");
    }


    protected void btReset_Click(object sender, EventArgs e)
    {
        resetAll();
    }

    private void resetAll()
    {
        txtAddress.Text = "";
        txtFax.Text = "";
        txtName.Text = "";
        txtPhone.Text = "";

    }
}